#pragma once

#include <MyFC/TextControl.h>
#include <MyFC/Glyph.h>
#include <MyViews/ZoomView.h>
#include "DLL.h"

namespace My {

class DLL_API ZoomTextEdit : public TextControl {
private:
	ZoomView *	m_pView;
protected:
	virtual bool GetText(String & s);
	virtual void SetText(const String & s);
public:
	ZoomTextEdit();
public:
	void SetView(ZoomView *);
	void UpdateScale();
public:
	virtual void HandleUpdateUI();
};

class DLL_API ZoomEdit : 
	public Widget, 
	public Container {
private:
	ZoomView *		m_pView;
	ZoomTextEdit	m_TextEdit;
	Glyph			m_Down;
	GrayedGlyph		m_Grayed;
	HCURSOR			m_hCurHandClick;
	CRect			m_DownRect;
public:
	ZoomEdit();
public:
	void SetView(ZoomView *);
	void DropDown();
public:
	virtual String Hint() const;
	virtual void LayoutControls();
	virtual void HandlePaint(CDC * pDC, const CRect & r);
	virtual void HandleLeftDown(unsigned int flags, const CPoint & p);
	virtual void HandleLeftDoubleClick(unsigned int flags, const CPoint & p);
	virtual bool HandleCursor(unsigned int flags, const CPoint & p);
};

} // My
